<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<!-- head 中 -->
	<link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
	<link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.min.css">
	<link rel="stylesheet" href="${s.base}/mobile/css/weuix.min.css" />
	<link rel="stylesheet" href="${s.base}/mobile/css/message.css"></head>
	<title>系统消息</title></head>
<body>
<div class="weui-cells" style="margin-top: 0;" id="xyg-show">

</div>
<div class="weui-loadmore xyg-product-list_loadmore weui-loadmore_line">
	<span class="weui-loadmore__tips">暂无数据</span>
</div>
<div id="about" class="weui-popup__container popup-bottom">
	<div class="weui-popup__overlay"></div>
	<div class="weui-popup__modal">
		<div class="system_messages">
			<div>
				<div class="role_box" style="height: auto;">
					<h3 style="margin: 0 auto;" id="title"></h3></div>
				<div class="role_feature">
					<ul class="weui-news-list">
						<li class="weui-news-item">
							<div class="weui-news-inners" style="width: 90%;padding-top: initial;">
								<div class="weui-news-title" id="createDate"></div>
								<div class="weui-news-text">
									<p class="weui-news-p" id="content"></p></div>
							</div>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
</div>

</body>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="${s.base}/mobile/js/jquery-2.1.4.min.js"></script>
<script src="${s.base}/mobile/js/swiper.min.js"></script>
<script src="${s.base}/mobile/js/zepto.weui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/mobile/js/base.js"></script>
<script src="${s.base}/mobile/js/jquery-weui.js"></script>

<!--js分享代码开始-->
<input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
<input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
<input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
<input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
<input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
<input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
<input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
<input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
<script src="${s.base}/mobile/js/share.js"></script>
<!--js分享代码结束-->
<script type="text/javascript">
    var memberId = '${memberId}';
    var pageStart=0;
    var num=10;
    var loading = false;  //状态标记
    sendPost();
    $(document).ready(function(e) {
        $(document.body).infinite().on("infinite", function() {
            if(loading) return;
            loading = true;
            sendPost();
        });
    });
    function sendPost() {
        $("#showContent").hide();
        pageStart++;
        $.post("/phone/myNews",{
            limit : num,
            page : pageStart,
            memberId:memberId
        },function(resultInfo){
            if (resultInfo.data!=null && resultInfo.data.length > 0){
                for(var j=0;j<resultInfo.data.length;j++){
                    var obj = resultInfo.data[j];
                    var itemListHtml='<div class="weui-cell" onclick="system_messages(\''+obj.id+'\')">'+
                        '<div class="weui-cell__bd">'+
                        '<p>'+obj.title+'</p>'+
                        '</div>'+
                        '<div class="weui-cell__ft">'+obj.createTime+'</div>'+
                        '</div>';
                    $("#xyg-show").append(itemListHtml);
                }
                loading = false;
                if(!resultInfo.hasNextPage){
                    $(document.body).destroyInfinite();
                    $(".xyg-product-list_loadmore").hide();
                }
            }else{
                $(document.body).destroyInfinite();
                $(".xyg-product-list_loadmore").hide();
            }

        },"json");
    }
    //弹出系统消息function
    function system_messages(id){
        $.post("/phone/myNewsDesc",{
            id : id
        },function(resultInfo){
            if(resultInfo.code==0){
                $("#title").html(resultInfo.data.title);
                $("#content").html(resultInfo.data.content);
                $("#createDate").html(resultInfo.data.createDate);
                $("#about").popup();
            }else{
               $.alert("操作失败!");
            }

        },"json");
    }
</script>
</html>